package com.learn.feign_service;

import com.learn.configuration.HystrixFallbackFactoryImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient(name = "PROJECT-SERVER-DEPT", fallbackFactory = HystrixFallbackFactoryImpl.class)
public interface DeptFeignService {
    @PostMapping("/dept/addDept")
    public String addDept(@RequestParam("name") String name);
    
    @PostMapping("/dept/findOneDept")
    public String findOneDept(@RequestParam("id") Integer id);
    
    @PostMapping("/dept/findAllDept")
    public String findAllDept();
    
    @PostMapping("/dept/hystrix/findOneDept")
    public String findOneDeptHystrix(@RequestParam("id") Integer id);
}
